﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Demo.Model;

using Pampa.CRUD;
using Pampa.CRUD.Core;
using Pampa.Grid.UI.CustomControls;
using Pampa.WebControls;

public partial class EntityList : AbstractPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string entityName = Request["entityName"];
 
        Ajax.Utility.RegisterTypeForAjax(typeof(CustomerController));
        Ajax.Utility.RegisterTypeForAjax(typeof(GridConfigurationController));

        customGrid.LoadEntityConfiguration(entityName);

        // Agrego el boton que abre la ventana de configuración
        this.quickFiltersPanel.Buttons.Add(new OpenConfigButton("configWindow"));

        // Boton para grabar la configuracion
        ClientButton btnOpenSaveConfig = new ClientButton();
        btnOpenSaveConfig.Type = Pampa.WebControls.ButtonType.Image;
        btnOpenSaveConfig.Text = "Save Configuration";
        btnOpenSaveConfig.IconPath = "Pampa.Common/save.gif";
        btnOpenSaveConfig.MethodName = "openSaveConfigurationWindow";
        this.quickFiltersPanel.Buttons.Add(btnOpenSaveConfig);

        // Boton para cargar una configuracion
        ClientButton btnOpenLoadConfig = new ClientButton();
        btnOpenLoadConfig.Type = Pampa.WebControls.ButtonType.Image;
        btnOpenLoadConfig.Text = "Load Configuration";
        btnOpenLoadConfig.IconPath = "Pampa.Common/load.gif";
        btnOpenLoadConfig.MethodName = "openLoadConfigurationWindow";
        this.quickFiltersPanel.Buttons.Add(btnOpenLoadConfig);
    }
}
